const KEY = 'ji-data'

export const load = () => {
  const v = localStorage.getItem(KEY)
  return v ? JSON.parse(v) : {}
}

export const save = (v: any) => {
  const s = JSON.stringify(v)
  if (s == '{}') localStorage.removeItem(KEY)
  else localStorage.setItem(KEY, s)
}
